package oop4.car;

public class CarTest {  //车辆检测中心
    public static void main(String[] args) {
        CarTest s1 = new CarTest("18956729857", "南京东路");
        //String brand, int price, String youHao, String color
        Sgmw car1 = new Sgmw("五菱宏光", 6, 2.4, "红色");
        Benz car2 = new Benz("奔驰", 35, 1.8, "黑色");
        Volkswagen car3 = new Volkswagen("大众", 16, 2.0, "灰色");
        s1.show();
        System.out.println();
        s1.test(car1);
        s1.test(car2);
        s1.test(car3);
    }

    String phone;
    String address;

    public CarTest(String phone, String address) {
        this.phone = phone;
        this.address = address;
    }

    public void show() {
        System.out.println("车辆检测中心地址:" + address + ",电话:" + phone);
    }

    public void test(Car car) {
        car.show();
        car.start();
        car.speedUp();
        car.brake();
        System.out.println();
    }


}
